/**
 * @author liangxi
 * @since 2024/4/11
 */

#include "NoQuarterState.h"
#include "../GumballMachine.h"

GumballMachine *NoQuarterState::getMGumballMachine() const {
    return mGumballMachine;
}

void NoQuarterState::setMGumballMachine(GumballMachine *mGumballMachine) {
    NoQuarterState::mGumballMachine = mGumballMachine;
}

void NoQuarterState::insertQuarter() {
    std::cout << "You inserted a quarter\n";
    mGumballMachine->setState(mGumballMachine->getHasQuarterState());
}

void NoQuarterState::ejectQuarter() {
    std::cout << "You have not inserted a quarter\n";
}

void NoQuarterState::turnCrank() {
    std::cout << "You turned,but there is no quarter\n";
}

void NoQuarterState::dispense() {
    std::cout << "You need to pay first\n";
}
